//
//  NetworkTools.m
//  Weibo
//
//  Created by student on 16/4/28.
//  Copyright © 2016年 Mcc. All rights reserved.
//

#import "NetworkTools.h"

static NetworkTools *instance=nil;

@implementation NetworkTools

+(NetworkTools *)sharedNetworkTools
{
    if (instance==nil)
    {
        NSURL *url=[NSURL URLWithString:@"https://api.weibo.com/"];
        instance=[[NetworkTools alloc]initWithBaseURL:url];
    }
    return instance;
}
-(instancetype)initWithBaseURL:(NSURL *)url
{
    self = [super initWithBaseURL:url sessionConfiguration:nil];
    
    //    self.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/html",@"text/plain", nil];
    
     // 返回的数据 responseObject 类型格式设置是二进制数据
    self.responseSerializer = [AFHTTPResponseSerializer serializer];
    
    return self;

}
@end
